
package processors;

import Errors.ErrorInformation;
import checker.checkerUser;

/**
 * Returns the string to id valid logins
 * @author Chris
 */
public class processorLogin extends processor {
    processorLogin(String query) { super(query); }
    
    @Override
    String process() {
        checkerUser CU = new checkerUser();
        if(!CU.isValid(_queryString)) {
            //Wrong password
            if(ErrorInformation.ERRORS.INVALID_PW == CU.lastError()) {
                return "2";
            }
            //Wrong Username
            return "1";
        }
        
        //All was valid
        return "0";
    }
}
